﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using FacebookApp;
using System.IO;
using System.Configuration;

/// <summary>
/// Summary description for FBGetData
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
[System.Web.Script.Services.ScriptService]
public class FBGetData : System.Web.Services.WebService {

    //private const string _path = ConfigurationSettings.AppSettings["fb_domain"].ToString() + "Service/userinfo.txt";
    public static List<string> AllData = new List<string>();
    public FBGetData () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public string SaveInfo(string id,string email,string name) {
      
        //WebMsgBox.Show("Hello");
        try
        {

            StreamWriter sw = new StreamWriter(ConfigurationSettings.AppSettings["fb_domain"].ToString() + "Service/" + id + ".txt");
            sw.Flush();
            sw.WriteLine(email);
            sw.WriteLine(name);
            sw.Close();
        }
        catch (Exception e)
        {
            //jsonData.Message = e.Message;
        }

        return "true";
    }

    [WebMethod]
    public string GetAllData()
    {
        //WebMsgBox.Show("Hello");
        return "";
    }
}

